package com.iro.blog.web;

import com.iro.blog.Service.BlogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ArchivesShowController {

    @Autowired
    private BlogsService blogsService;
    @GetMapping("/archives")
    public String archives(Model model){


    model.addAttribute("archiveMap",blogsService.archivesBlog());
    model.addAttribute("blogCount",blogsService.countBlog());
        model.addAttribute("recommendBlogs",blogsService.listRecommendBlogTop(1));

        return "archives";
    }
}
